package cn.iocoder.yudao.module.product.controller.admin.sku;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuSpuRespVO;
import cn.iocoder.yudao.module.product.service.sku.ProductSkuService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 商品 SKU")
@RestController
@RequestMapping("/product/sku")
@Validated
public class ProductSkuController {
    @Resource
    private ProductSkuService productSkuService;

    @GetMapping("/discount-list")
    @Operation(summary = "获得优惠活动商品")
    public CommonResult<List<ProductSkuSpuRespVO>> getDiscountList(@RequestParam Long activityId) {
        List<ProductSkuSpuRespVO> list = productSkuService.getDiscountList(activityId);
        return success(list);
    }

}
